﻿@model IEnumerable<Back_end.Models.Complaint>

@{
    ViewBag.Title = ViewBag.UserName + "举报记录";
}

<h2>@ViewBag.Title</h2>

<table class="table">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.UserName)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.PublishedDate)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Text)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Location)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.AllowedPublished)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.HadProcessed)
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.UserName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.PublishedDate)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Text)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Location)
        </td>
        <td>
            @{  if (item.AllowedPublished == null)
                { <span class="label label-default">未审核</span> }
                else if (item.AllowedPublished == true)
                { <span class="label label-success">已通过</span> }
                else
                { <span class="label label-warning">未通过</span> }
            }
        </td>
        <td>
            @{  if (item.HadProcessed == null)
                { <span class="label label-default">未处理</span> }
                else if (item.HadProcessed == true)
                { <span class="label label-success">已处理</span> }
                else
                { <span class="label label-warning">处理中</span> }
            }
        </td>
        <td>
            @Html.ActionLink("编辑", "Edit", "Complaints", new { id=item.ComplaintId }, null) |
            @Html.ActionLink("详细", "Details", "Complaints", new { id=item.ComplaintId }, null) |
            @Html.ActionLink("删除", "Delete", "Complaints", new { id=item.ComplaintId }, null)
        </td>
    </tr>
}

</table>
